<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>打开窗口</title>
    <script>
        function f1(){
            window.open();
        }
        function f2(){
            // 所有window相关的属性与方法均可以省略调用者
            // 参数一:指定打开的窗口对应的页面是谁
            open("01-引入方式.html");
        }
        function f3(){
            // 参数一:指定打开的窗口对应的页面是谁
            // 参数二:
            open("01-引入方式.html","aa","width=400px,height=300px");
        }
        function f4(){
            setInterval(function(){
                open("01-引入方式.html","aa","width=400px,height=300px");
            },200)
        }
        function f5(){
            // open方法存在返回值,其返回值即为当前打开的窗口对象
            let win = open("01-引入方式.html","aa","width=400px,height=300px");
            win.close();
        }
        function f6(){
            let win = open("33-事件冒泡.html","aa","width=400px,height=300px");
            setTimeout(function(){
                win.close();
            },3000)
        }
        function f7(){
            let t = setInterval(function(){
                open("01-引入方式.html","aa","width=400px,height=300px");
            },200);
            let t2 = setTimeout(function(){
                clearInterval(t);
            },3000)
            clearTimeout(t2);
        }
        function f8(){
            open("38-地址栏.html","aa","width=500px,height=400px")
        }
    </script>
</head>
<body>
<button onclick="f1()">打开一个新的标签页</button><br>
<button onclick="f2()">打开一个指定窗口</button><br>
<button onclick="f3()">打开一个小窗口</button><br>
<button onclick="f4()">无限打开一个小窗口</button><br>
<button onclick="f5()">打开并关闭一个小窗口</button><br>
<button onclick="f6()">打开三秒后关闭一个小窗口</button><br>
<button onclick="f7()">无限打开一个小窗口,三秒后停止</button><br>
<button onclick="f8()">打开38的窗口</button>
</body>
</html>